package com.kly.msg.controller;

import com.fqgj.log.factory.LogFactory;
import com.fqgj.log.interfaces.Log;
import com.kly.dto.MsgResultDto;
import com.kly.dto.SmsRequestDTO;
import com.kly.msg.FcmClient;
import com.kly.service.SMSService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;


/**
 * 测试接口不对外暴露
 */
@RestController
@RequestMapping("sms")
public class OKController {

    private static Log LOGGER = LogFactory.getLog(OKController.class);

    @Autowired
    SMSService smsService;
    @RequestMapping(value = "/sendSMS")
    public void test(@RequestBody SmsRequestDTO requestDTO){
        MsgResultDto msgResultDto = smsService.sendSMS(requestDTO);

    }
    @RequestMapping(value = "/ok")
    public String ok(String phone,Integer region){
        LOGGER.info("TEST OK");
        return "ok";
    }
    @RequestMapping(value = "/test")
    public String test() throws IOException {
         return new FcmClient().sendMsg();
    }
}
